<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../jquery.min.js"></script>
</head>
<body>
<h1 id="h1">我是副页网站</h1>
</body>
<script>
    window.onload = function() {
        window.addEventListener('message', function(event) {
            console.log(event.data)
        })
    }
    h1.onclick = function () {
        window.top.postMessage({
                action: "getUname"
            }, "*")
    }
</script>
</html>